package com.vincent.sciinfo.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class DateUtil {

    public static int GetEndDate(){
        Calendar calendar = Calendar.getInstance();
        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyyMMdd");
        calendar.add(Calendar.DATE, 7);
        String days = sdf2.format(calendar.getTime());
        return  Integer.parseInt(days);
    }

    public static String GetDate(){
        SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");//设置日期格式
        return  df.format(new Date());
    }

    public static int YMDToNum(){
        return Integer.parseInt(DateUtil.GetDate());
    }
}
